package net.display;

import javax.servlet.http.HttpServletRequest;

import net.bo.KPlan;
import net.ko.displays.KObjectDisplay;
import net.ko.kobject.KObject;

public class DisplayDistributionPlan extends KObjectDisplay {
	@Override
	public String getCaption(Class<? extends KObject> clazz) {
        return "Plan";
	}
	
	@Override
	public String showInList(KObject ko, String memberName,HttpServletRequest request) {
		String result=super.showInList(ko, memberName,request);
		KPlan plan=(KPlan) ko;
		if("libelle".equals(memberName)){
			result="<a id='"+ko.getId()+"' class='showUser'>"+plan.getLibelle()+"</a>";
		}else if("active".equals(memberName)){
			if(plan.isActive()){
				result="<img src='https://cdn1.iconfinder.com/data/icons/fatcow/16/bullet_valid.png'/>";
			}else{ 
				result="<img src='https://cdn1.iconfinder.com/data/icons/lynx/16x16/actions/dialog-close.png'/>";
			}
		
	}
		return result;

	}

}
